/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.fiap.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author rm64396
 */
public class GerenciadorConexoes {
    private static GerenciadorConexoes singletonConexoes = new GerenciadorConexoes();
    private GerenciadorConexoes(){
        try{
            Class.forName("org.apache.derby.jdbc.ClientDriver");
        } catch (ClassNotFoundException ex){
            throw new RuntimeException(ex);
        }
    }
    public static GerenciadorConexoes obterGerenciador(){
        return singletonConexoes;
    }
    public Connection obterConexao() throws SQLException{
        return DriverManager.getConnection(
                "jdbc:derby://localhost:1527/fiap-3sia-rm64396",
                "rm64396",
                "rm64396");
    }
}
